Entity References, Entity Void, and Polymorph Bugfixes#433
Open
Zetaplx wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
About the PR
Oh goodness... a lot actually. First and foremost this PR fixes a major bug with how polymorph works. The existing code will cause saves to fail to load as it relies on shunting an entity to a new empty and paused map. To resolve this, I created what I call the EntityVoidSystem which serializes entities and stores them in files that can be called back at a later date. Files are saved in a safe place and labeled with an entity's PersistentIdentifier so they are persistent safe.
As a side note (and as was my original goal before getting sucked down the polymorph rabbit hole), added a PersistentEntityReference data type to naturally hold onto PIDs in the future. Integrated into the PersistentIdentifierSystem and is the easiest way to modify existing systems to use PIDs.
Finally, since this has a lot to do with polymorphing, added a verb for admins to manually de-polymorph someone if they want to.
Note
I tested this as best as I could, but I am ultimately one person with one person's worth of time. There should be no game breaking bugs in this.
Why / Balance
Technical details
Theres... there's a lot. Read the diffs or ask me if you have big questions. Comments are there to hopefully help too.
Requirements
Breaking changes
This may break existing code relying on the inner workings of the polymorph system. It should be plug and play and works with existing implementations but the #429 may need some tweaking, not sure.
Changelog
🆑